package com.yocard.yxyd.ui.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.view.View;
import android.webkit.ValueCallback;

import com.yocard.yxyd.R;

/**
 * Created on 2019/4/9.
 */
public class OpenwxDialog extends Dialog {

    private final ValueCallback<String> callback;

    public OpenwxDialog(@NonNull Context context, ValueCallback<String> callback) {
        super(context, R.style.MyDialogStyle);
        this.callback = callback;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_open_wx);
        setCanceledOnTouchOutside(true);

        View view = findViewById(R.id.tv_wx);
        view.setOnClickListener(v->{
            callback.onReceiveValue("");
            dismiss();
        });
        findViewById(R.id.iv_share_bg).setOnClickListener(v->{
            dismiss();
        });
    }
}
